package com.cloud.spring.bean;

import com.cloud.spring.demo.entity.Address;
import com.cloud.spring.demo.entity.User;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class BeanStore {
    public static User createUser() {
        User user = new User();
        user.setId(1);
        user.setAge(18);
        user.setBirth(LocalDate.parse("1993-09-16"));
        user.setName("tom-1");
        user.setCreateTime(LocalDateTime.now());
        Address address = new Address();
        address.setId(1);
        address.setAddress("烟台-1");
        address.setCreateTime(LocalDateTime.now());
        List<Address> addressList=new ArrayList<>();
        addressList.add(address);
        addressList.add(address);
        user.setAddress(addressList);
        user.setRoles(new int[]{
                1,2,3,5,6
        });
        return user;
    }

    public static Address createAddress() {
        Address address = new Address();
        address.setId(1);
        address.setAddress("烟台-2");
        address.setCreateTime(LocalDateTime.now());
        return address;
    }
}
